From 6527a3576594fc98eb30fd4b8676464668833ae0 Mon Sep 17 00:00:00 2001 From: "stekloff@elm3b216.beaverton.ibm.com" Date: Fri, 10 Mar 2006 10:54:25 +0100 Subject: [PATCH] Fix test 11_create_concurrent_ps.py for HVM domains. HVM can only load as many disk.img domains as there are loop devices. Added a small function to get number of loop devices to be used as a max for number of concurrent domains the test launches. Signed-off-by: Daniel Stekloff --- tools/xm-test/lib/XmTestLib/Test.py | 12 +++++++++++- .../xm-test/tests/create/11_create_concurrent_pos.py | 10 ++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/xm-test/lib/XmTestLib/Test.py b/tools/xm-test/lib/XmTestLib/Test.py index 8f0f58df3f..32d1574eae 100644 --- a/tools/xm-test/lib/XmTestLib/Test.py +++ b/tools/xm-test/lib/XmTestLib/Test.py @@ -32,6 +32,7 @@ import pty import select import signal import re +import glob TEST_PASS = 0 TEST_FAIL = 255 @@ -184,7 +185,16 @@ def isConsoleDead(): domain.destroy() return False - + +# +# We currently can only load as many concurrent HVM domains as loop +# devices, need to find how many devices the system has. +def getMaxHVMDomains(): + nodes = glob.glob("/dev/loop*") + maxd = len(nodes) + + return maxd + if __name__ == "__main__": diff --git a/tools/xm-test/tests/create/11_create_concurrent_pos.py b/tools/xm-test/tests/create/11_create_concurrent_pos.py index d850642e45..7ae74d18a6 100644 --- a/tools/xm-test/tests/create/11_create_concurrent_pos.py +++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py @@ -8,8 +8,14 @@ from XmTestLib import * import time import random -MIN_DOMS = 10 -MAX_DOMS = 50 +if ENABLE_HVM_SUPPORT: + MAX_DOMS = getMaxHVMDomains() + if MAX_DOMS > 50: + MAX_DOMS = 50 +else: + MAX_DOMS = 50 + +MIN_DOMS = 5 MEM_PER_DOM = 24 domains = [] -- 2.30.2